<?php

require '../../../../src/Reactor/Swoole/MultiAdvance/Worker.php';
require 'Test.php';

use Snitso\IO\Reactor\Swoole\MultiAdvance\Worker;

$worker = new Worker('tcp://0.0.0.0:9001');

$worker->watchFile = true;

$worker->onConnect = function (Worker $worker, $conn) {
    echo '有一个连接进来了' . PHP_EOL;
};

$worker->onReceive = function (Worker $worker, $conn, $data) {
    (new Test())->go();
    $worker->send($conn, 'Hello Baby' . PHP_EOL);
};

$worker->start();